package difangame.sprite;

import java.awt.Point;
import difangame.Constants;
import framework.Level;
import framework.Sprite;


public class Clinger extends Sprite {

    protected int pointValue;
    protected Sprite myCarrier = null;
    private String myImageFile = "candy.gif";
    private int myWidth;
    private int myHeight;

    @Override
    public void initialize (Point position, Level l) {
        super.superInitialize(position, myImageFile, myWidth, myHeight, l);
        setMyName(Constants.clinger);
    }

    @Override
    protected void move () {
        moveWithCarrier();
    }

    protected void moveWithCarrier () {
        if (hasCarrier()) {
            setMyCenter(myCarrier.getMyCenter());
        }
    }

    @Override
    protected void action () {
    }

    public void setMyCarrier (Sprite c) {
        myCarrier = c;
    }

    protected Sprite getMyCarrier () {
        return myCarrier;
    }

    public boolean hasCarrier () {
        return (myCarrier != null);
    }

    /*
     * public void setMyImage(String s){
     * myImageFile = s;
     * }
     */
}
